<template>
<!-- 体检结果 -->
    <div>
         <!-- 头部 -->
        <div class="frist_show">
            <el-breadcrumb separator-class="el-icon-arrow-right">
              <el-breadcrumb-item :to="{ path: '/home' }">首页</el-breadcrumb-item>
             <el-breadcrumb-item :to="{ path: '/report' }">报告查询</el-breadcrumb-item>
              <el-breadcrumb-item>体检结果</el-breadcrumb-item>
            </el-breadcrumb>
            <el-divider></el-divider>
        </div>
        <div style="width:1300px;height:500px;position: absolute;top:100px;left:100px;box-shadow: 0 2px 4px rgba(0, 0, 0, .12), 0 0 6px rgba(0, 0, 0, .04);">
            <div style="width:1100px;position: absolute;top:120px;left:100px">
                <el-descriptions class="margin-top" :column="3" :size="size" border>
                <el-descriptions-item>
                <template slot="label">
                    <i class="el-icon-user"></i>
                    编号
                </template>
                {{listreslut.besResultId}}
                </el-descriptions-item>
                <el-descriptions-item>
                <template slot="label">
                    <i class="el-icon-mobile-phone"></i>
                    姓名
                </template>
                {{listreslut.besResultName}}
                </el-descriptions-item>
                <el-descriptions-item>
                <template slot="label">
                    <i class="el-icon-location-outline"></i>
                    上传时间
                </template>
               {{listreslut.besResultCreateTime}}
                </el-descriptions-item>
                <el-descriptions-item>
                <template slot="label">
                    <i class="el-icon-tickets"></i>
                   年龄
                </template>
                {{listreslut.besResultAge}}
                </el-descriptions-item>
                <el-descriptions-item>
                <template slot="label">
                    <i class="el-icon-office-building"></i>
                   体检描述
                </template>
                {{listreslut.besResultContent}}
                </el-descriptions-item>
                <el-descriptions-item>
                <template slot="label">
                    <i class="el-icon-office-building"></i>
                    体检结果
                </template>
                    {{listreslut.besResultNormal}}
                </el-descriptions-item>
                <el-descriptions-item v-if="listreslut.besResultHealth === 1 ? true:false">
                <template slot="label">
                    <i class="el-icon-office-building"></i>
                    是否被干预
                </template>
                    <a @click="lookhealth">查看干预方案</a>
                </el-descriptions-item>
                <el-descriptions-item v-if="listreslut.besResultHealth === 0 ? true:false">
                <template slot="label">
                    <i class="el-icon-office-building"></i>
                    是否被干预
                </template>
                    否
                </el-descriptions-item>
                <el-descriptions-item>
                <template slot="label">
                    <i class="el-icon-office-building"></i>
                    体检报告
                </template>
               <a target="_blank" :href="'http://192.168.43.183/files/'+ listreslut.besResultZip">查看体检结果详情报告</a>
                </el-descriptions-item>
             </el-descriptions>
            </div>
        </div>
    </div>
</template>

<script>
export default {
  name: 'Sculpture',
  data () {
    return {
      besid: this.$route.params.besid,
      listreslut: {},
      listclass: [],
      size: ''
    }
  },
  methods: {
    initBspeakResult () {
      this.$axios.post(`/api/bespeakresult/Bespeakrest/${this.besid}`).then(result => {
        this.listreslut = result.data
        this.$axios.post(`/api/bespeakresult/personclassification`).then(results => {
          results.data.forEach((item, index) => {
            if (item.perClassId === result.data.besResultNormal) {
              this.listreslut.besResultNormal = item.perClassName
            }
          })
        })
      })
    },
    lookhealth () {
      this.$router.push('/health/' + this.listreslut.interId + '/' + this.besid)
    }
  },
  created () {
    this.initBspeakResult()
  }
}
</script>

<style>
.frist_show{position: absolute;top: 0px;left:20px;width: 1500px;height: 50px;}
.frist_show .el-breadcrumb{margin-top: 15px;}
</style>
